Online PHP Function(s){ #Test PHP functions online!; }

  •  
 

 
Added: 08/09/2012 by John

About linux command find

You can do a lot of things with find these days.
In this article some very useful commands with find.

Find large files

find /home -type f -size +5000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Find files / directories with 777 permissions

#find 777 files
find / -type f -perm 0777
#find 777 dirs
find / -type d -perm 0777

You can also combine find to skip some folders when copying using this article. Prune tells it to also skip subfolders and subfiles.
find . ! \( -name images -prune \) -print | cpio -o | ttcp -t yourserver.com -p 10000

Find empty files

find /home -type f -size -1b -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Find empty files and delete

find /tmp -type f -empty -delete

Find smallest files and delete them

ls . -S | tail -250 | xargs rm

Find largest files

ls . -Srl | tail -250



 

 

 


Comments

 
 
      © 2019 OnlinePHPFunctions.com | Disclaimer |       PHP versions: 7.2.4, 7.1.0, 7.0.14, 7.0.5, 7.0.4, 7.0.3, 7.0.2, 7.0.1, 5.6.29, 5.6.20, 5.6.19, 5.6.18, 5.6.17, 5.6.2, 5.5.34, 5.5.33, 5.5.32, 5.5.31, 5.5.18, 5.5.5, 5.5.0.a6, 5.5.0.a.5, 5.5.0.a.2, 5.4.34, 5.4.21, 5.4.13, 5.4.12, 5.4.11, 5.4.10, 5.4.9, 5.4.8, 5.4.7, 5.4.6, 5.4.5, 5.4.4, 5.4.3, 5.4.2, 5.4.1, 5.4.0, 5.3.29, 5.3.27, 5.3.23, 5.3.22, 5.3.21, 5.3.20, 5.3.19, 5.3.18, 5.3.17, 5.3.16, 5.3.15, 5.3.14, 5.3.13, 5.3.12, 5.3.11, 5.3.10, 5.3.2, 5.3.1, 5.3.0, 5.2.17, 5.2.16, 5.1.6, 5.1.5, 5.0.5, 5.0.4, 4.4.9